\documentclass{article}

\usepackage[square,sort,comma,authoryear]{natbib}

\usepackage{url}                  % format URLs

\begin{document}

main text citet example: \citet{Test:Book} main text

main text(don't forget the half-space, citep:) ctanchor\,\citep{Test:Book}.
text main.

\bibliographystyle{abbrvnat}
\bibliography{references}

\end{document}
